<style>
    #RFManage {
        width: 100%;
        min-width: 890px;
        position: relative;
    }

    #RFManage .demo-table-expand {
        font-size: 0;
    }

    #RFManage .demo-table-expand label {
        width: 90px;
        color: #99a9bf;
    }

    #RFManage .demo-table-expand .el-form-item {
        margin-right: 0;
        margin-bottom: 0;
        width: 80%;
    }

    #RFManage .el-table__expand-column .el-table__expand-icon {
        height: 39px;
    }

    #RFManage .table {
        transition: 1s all;
    }

    #RFManage .el-carousel__container {
        height: 440px;
    }

    .el-tooltip__popper {
        max-width: 400px;
    }

    .el-step__main {
        max-width: calc(100% - 60px);
    }

    #RFManage .RFManageTable {
        width: 95% !important;
        margin: 10px 20px 0;
    }

    #RFManage .datePicker {
        width: 140px !important;
        height: 24px !important;
        margin-top: 29px;
        margin-right: 18px;
        float: left;
    }

    #RFManage .datePicker .el-input__inner {
        border-radius: 2px !important;
        height: 24px !important;
    }

    #RFManage .add {
        background: url("/static/images/add.png") no-repeat center;
    }

    #RFManage .del {
        background: url("/static/images/del.png") no-repeat center;
    }

    #RFManage .search {
        background: url("/static/images/search.png") no-repeat center;
    }

    #RFManage .sel {
        background: url("/static/images/sel.png") no-repeat center;
    }

    #RFManage .icon {
        float: left;
    }

    #RFManage .btn span {
        float: left;
        margin-top: 4px;
        margin-left: 2px;
    }

    #RFManage .btn {
        height: 24px;
        line-height: 1;
        border: none;
        background: #f8fafb;
        outline: none;
        cursor: pointer;
        padding: 0;
        margin: 0;
        float: left;
        font-size: 14px;
        color: #1f2d3d;
        margin-top: 29px;
        margin-right: 16px;
    }

    #RFManage .btn-print {
        margin-right: 0;
    }

    #RFManage .btn:hover {
        color: #5468ee;
    }

    #RFManage .inner {
        margin: 0 20px;
    }

    #RFManage .btn-nav {
        height: 60px;
        overflow: hidden;
    }

    #RFManage .btn-nav .el-input .el-input__inner {
        height: 24px;
    }

    #RFManage .btn-nav .el-input {
        float: left;
        margin-top: 29px;
        margin-right: 18px;
        width: 140px;
        height: 24px;
    }

    #RFManage h4 {
        padding-left: 20px;
        margin-bottom: 0px;
    }

    #RFManage .formBottom {
        margin-top: 10px;
    }

    #RFManage .RFManageCombinationDetails .el-date-editor.el-input {
        width: 100%;
    }

    #RFManage .RFManageCombinationDetails {
        margin-top: 30px;
    }
</style>
<style>
    .steps {
        position: absolute;
        bottom: 10px;
        left: 30px;
        margin: auto;
    }

    .el-dialog__headerbtn {
        position: absolute;
        right: 25px;
        top: 15px;
    }

    .el-step__main {
        margin-left: -8px !important;
    }
</style>
<style>
    .el-date-editor.el-input {
        width: 100%;
    }
</style>

<div id="RFManage">
    <!--页面调整-->
    <el-row
            v-loading="showLoading"
            element-loading-text="拼命加载中">
        <div class="inner btn-nav">

            <el-input
                    v-model="ruLoginName"
                    icon="search"
                    placeholder="账户"></el-input>
            <el-input
                    v-model="ruUserZyq"
                    icon="search"
                    placeholder="作业区"></el-input>
            <button
                    class="btn"
                    v-show="multiSelect&&multipleSelection.length==1"
                    @click="multiOperationEdit">编辑
            </button>
        </div>
        <el-table
                :data="RFManage"
                :max-height="config_table_height()"
                ref="table"
                class="RFManageTable"
                @selection-change="multiSelectionChange"
                style="width: 100%">
          <el-table-column
              width="80"
              type="index">
          </el-table-column>
            <!--<el-table-column-->
                    <!--type="expand">-->
                <!--<template scope="props">-->
                    <!--<el-row>-->
                        <!--<el-col :span="10">-->
                            <!--<el-form label-position="left" inline class="demo-table-expand">-->
                                <!--<el-form-item label="账户">-->
                                    <!--<span>{{ props.row.ruLoginName        }}</span>-->
                                <!--</el-form-item>-->
                                <!--<el-form-item label="类型">-->
                                    <!--<el-tag-s :val="auto_el_tag('ruUserType',props.row.ruUserType)"></el-tag-s>-->
                                <!--</el-form-item>-->
                            <!--</el-form>-->
                        <!--</el-col>-->
                        <!--<el-col :span="14">-->
                            <!--<el-form label-position="left" inline class="demo-table-expand">-->
                                <!--<el-form-item label="主要作业区">-->
                                    <!--<span>{{ props.row.firstZyq   }}</span>-->
                                <!--</el-form-item>-->
                                <!--<el-form-item label="次要作业区">-->
                                    <!--<span>{{ props.row.secondZyq }}</span>-->
                                <!--</el-form-item>-->


                                <!--<el-form-item label="可用操作">-->
                                    <!--<el-button-->
                                            <!--size="small"-->
                                            <!--icon="edit"-->
                                            <!--@click="inlineEdit(props.$index, props.row)">-->
                                    <!--</el-button>-->
                                    <!--<el-button-->
                                            <!--size="small"-->
                                            <!--icon="relation"-->
                                            <!--@click="inlineRelation(props.$index, props.row)">关联作业区-->
                                    <!--</el-button>-->
                                <!--</el-form-item>-->
                            <!--</el-form>-->
                        <!--</el-col>-->
                    <!--</el-row>-->
                <!--</template>-->
            <!--</el-table-column>-->
            <el-table-column
                    label="账户"
                    show-overflow-tooltip
                    align="center">
                <template scope="scope">
                    <span>{{ scope.row.ruLoginName}}</span>
                </template>
            </el-table-column>
            <el-table-column
                    label="类型"
                    align="center">
                <template scope="scope">
                    <el-tag-s :val="auto_el_tag('ruUserType',scope.row.ruUserType)"></el-tag-s>
                </template>
            </el-table-column>
            <el-table-column
                    label="主要作业区"
                    align="center">
                <template scope="scope">
                    <span>{{ scope.row.firstZyq }}</span>
                </template>
            </el-table-column>
            <el-table-column
                    label="次要作业区"
                    align="center">
                <template scope="scope">
                    <span>{{ scope.row.secondZyq}}</span>
                </template>
            </el-table-column>
            <el-table-column
                    v-if="multiSelect"
                    type="selection"
                    width="60">
            </el-table-column>
        </el-table>
        <div class="block">
            <el-pagination
                    @size-change="handleSizeChange"
                    @current-change="handleCurrentChange"
                    :current-page="currentPage"
                    :page-sizes="[5, 10, 15, 20, 100, 500, 1000, 5000, 10000]"
                    :page-size="pageSize"
                    layout="total, sizes, prev, pager, next, jumper"
                    :total="currentTotal">
            </el-pagination>
        </div>
    </el-row>
    <el-dialog
            size="large"
            v-model="dialogFormVisible">
        <div class="dialog-title clearfix" slot="title">
            <span class="el-dialog__title">{{form.title}}</span>
            <el-steps
                    class="steps"
                    :space="120"
                    :active="dialogFormActive"
                    finish-status="success">
            </el-steps>
        </div>
        <el-form :model="form" ref="newForm">
            <el-carousel
                    ref="carousel"
                    :autoplay="false"
                    arrow="never"
                    indicator-position="none"
                    height="55vh">
                <el-carousel-item>
                    <el-row>
                        <el-col :span="10">
                            <el-form-item
                                    label="账户"
                                    :label-width="formLabelWidth">
                                <el-input
                                        v-model.number="form.ruLoginName"
                                        auto-complete="off"></el-input>
                            </el-form-item>
                            <el-form-item
                                    label="类型"
                                    :label-width="formLabelWidth">
                                <el-input
                                        v-model.number="form.ruUserType"
                                        auto-complete="off"></el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="10" :offset="2">
                            <el-form-item
                                    label="主要作业区"
                                    :label-width="formLabelWidth">
                                <el-input
                                        v-model.number="form.ruUserZyq"
                                        auto-complete="off"></el-input>
                            </el-form-item>
                            <el-form-item
                                    label="次要作业区"
                                    :label-width="formLabelWidth">
                                <el-input
                                        v-model.number="form.ruUserZyq"
                                        auto-complete="off"></el-input>
                            </el-form-item>

                        </el-col>
                    </el-row>
                </el-carousel-item>
                <el-carousel-item>
                    <el-row>

                    </el-row>
                </el-carousel-item>
                <el-carousel-item>
                    <el-row>

                    </el-row>
                </el-carousel-item>
            </el-carousel>
        </el-form>

        <div slot="footer" class="dialog-footer">
            <el-button type="primary" @click="submit" :loading="submitLoading"
                       v-show="dialogFormActive >= 2">保存
            </el-button>
            <el-button type="primary" @click="submit" :loading="submitLoading"
                       v-show="dialogFormActive >= 2">取消
            </el-button>
        </div>
    </el-dialog>
    <el-dialog
            size="tiny"
            v-model="dialogRoleVisible">
        <div class="dialog-title clearfix" slot="title">
            <span class="el-dialog__title">配置角色</span>
        </div>

        <el-form :model="warehouseForm" ref="newRoleForm">
            <el-row>
                <el-radio v-for="city in role" v-model="warehouseForm.roleId" :label="city.rrRoleId">{{city.rrName}}
                </el-radio>
            </el-row>
        </el-form>
        <div slot="footer" class="dialog-footer">
            <el-button type="primary" @click="submitRole" :loading="loadingWarehouse">保存
            </el-button>
        </div>
    </el-dialog>
</div>

<script>
    var RFManage = new Vue({
        el: '#RFManage',
        prop: {},
        data: function () {
            return {
                RFManage: [],      //主页面 信息集合
                multipleSelection: [],           //主页面 多选集合
                multiSelect: false,              //主页面 多选状态 维护

                ruLoginName: '',                  //TODO RF主页面 账户
                ruUserZyq: '',                   //TODO RF主页面 作业区  搜索
                showLoading: false,              //主页面 加载 维护

                currentPage: 1,                  //分页 当前页
                currentTotal: 1,                 //分页 总页数
                pageSize: 10,                    //分页 分页大小

                formLabelWidth: '120px',         //表单 配置

                form: form(),                    //新建 弹出层 信息集合
                dialogFormActive: 0,             //新建 弹出层 steps 当前进度
                dialogFormVisible: false,        //新建 弹出层 是否可见
                submitLoading: false,            //新建 弹出层 提交等待

                pickerOption: {
                    disabledDate: function (time) {
                        return time.getTime() > Date.now();
                    }
                },             //新建 弹出层 相对湿度选项

                dialogRoleVisible: false,        //仓库管理 弹出层 是否可见
                loadingWarehouse: false,         //仓库管理 弹出层 提交等待
                role: [],                        //仓库管理 集合
                warehouseForm: {

                },            //仓库管理 弹出层 信息集合

            }
        },
        computed: {
            option: function () {
                return {
                    "draw": 1,
                    "pageNum": this.currentPage,
                    "pageSize": this.pageSize,
                    "ruLoginName":this.ruLoginName.trim(),
                    "ruUserZyq":this.ruUserZyq.trim()
                }
            },           //主页面 post 0
        },
        methods: {
            inlineEdit: function (index, row) {
                this.form.title = '编辑';
                this.form.ruLoginName = row.ruLoginName;
                this.form.ruUserType = row.ruUserType;
                this.form.ruUserZyq = row.ruUserZyq;
                this.form.ruUserZyq = row.ruUserZyq;
                this.form.ruStatus = parseInt(row.ruStatus);
                this.dialogFormVisible = true;
                this.dialogFormActive = 0;
                Vue.nextTick(function () {
                    RFManage.$refs.carousel.setActiveItem(0);
                });
            },                                  //TODO 行内按钮-编辑
            inlineRelation: function (index, row) {
                this.form.title = '关联作业区';
//                this.form.ruLoginName = row.ruLoginName;
//                this.form.ruLoginName = row.ruLoginName;
                this.dialogFormVisible = true;
//                this.dialogFormActive = 0;
//                Vue.nextTick(function () {
//                    RFManage.$refs.carousel.setActiveItem(0);
//                });
            },                             //TODO 行内按钮-关联作业区
            multiSelectClick: function () {
                this.multiSelect = !this.multiSelect;
            },                                      //多选 状态维护
            multiSelectionChange: function (val, row) {
                this.multipleSelection = val;
            },                          //多选 选中控制
            multiOperationEdit: function () {
                this.inlineEdit(1, this.multipleSelection[0]);
            },                                    //多选 编辑
            handleSizeChange: function (val) {
                /*<debug>*/
                console.log('每页' + val + '条');
                /*</debug>*/
                this.pageSize = val;
                p[0].post( this.option);
            },                                   //分页 Size
            handleCurrentChange: function (val) {
                /*<debug>*/
                console.log('当前第' + val + '页');
                /*</debug>*/
                this.currentPage = val;
                p[0].post( this.option);
            },                                //分页 当前页
            newInput: function () {
                this.form = form();
                this.dialogFormVisible = true;
                this.dialogFormActive = 0;
                Vue.nextTick(function () {
                    RFManage.$refs.carousel.setActiveItem(0);
                });
            },                                              //按钮 新建入库单
            warehouseManage: function () {
                this.form = form();
                this.dialogFormVisible = true;
                this.dialogFormActive = 0;
                Vue.nextTick(function () {
                    RFManage.$refs.carousel.setActiveItem(0);
                });
            },                                       //TODO 按钮 仓库管理
            prev: function () {
                this.dialogFormActive--;
                this.$refs.carousel.prev();
            },                                                  //新建 弹出层banner控制 前一个
            next: function () {
                this.dialogFormActive++;
                this.$refs.carousel.next();
            },                                                  //新建 弹出层banner控制 后一个
            submit: function () {
                var _this = this;
                this.dialogFormActive++;
                this.submitLoading = true;
                //TODO 此处应是ajax请求


                /*<prod>*/
                if (this.form.title === '新建仓库') {
                    postSubmit(this, this.form);
                } else {
                    postModify(this, this.form);
                }
                /*</prod>*/
                /*<debug>*/
                setTimeout(function () {
                    _this.submitLoading = false;
                    _this.$notify({
                        title: '成功',
                        message: '保存成功！',
                        type: 'success'
                    });
                    _this.dialogFormVisible = false;
                    _this.dialogFormActive = 0;
                    _this.$refs.carousel.setActiveItem(0);
                    p[0].post();
                }, 1500);
                /*</debug>*/
            },                                                //新建 表单提交
            submitRole: function () {
                var _this = this;
                this.loadingWarehouse = true;

                /*<prod>*/
                //TODO
                postModify(this, this.form);
                /*</prod>*/
                /*<debug>*/
                setTimeout(function () {
                    _this.loadingWarehouse = false;
                    _this.dialogRoleVisible = false;
                    _this.$notify({
                        title: '成功',
                        message: '更换仓库管理成功！',
                        type: 'success'
                    });
                }, 1500);
                /*</debug>*/
            },                                            //新建 表单提交
            auto_ruUserType:function(value){
                var temp={}
                if(!isNaN(value)){
                    temp={
                        0:'普通',
                        1:'堆高车',
                        2:'高位叉车',
                    }
                }else{
                    temp={
                        '普通':0,
                        '堆高车':1,
                        '高位叉车':2
                    }
                }
                return temp[value];
            },                                      //类型
        },
        watch: {
            ruLoginName: function () {
                /*<debug>*/
                console.log(this.option);
                /*</debug>*/
                p[0].post( this.option);
            },
            ruUserZyq: function () {
                /*<debug>*/
                console.log(this.option);
                /*</debug>*/
                p[0].post( this.option);
            }
        }
    });
   function  form() {
        return {
            arehouseId: 1,          //仓库id
            title: "新建仓库",
            Name: '',               //仓库名称
            Addr: '',               //仓库地址
            Scontacts: '',          //联系人/负责人
            Phone: '',              //电话
            Remarks: '',            //备注
            Ctype: '',              //仓库类型
            Humidity: '',           //相对湿度
            Postoffice: '',         //邮编
            Fax: '',                //传真
        }
    };               //弹出层 form 模板
    var obj=RFManage;
    var p=[];
    // 0 RF管理 分页查询
    p[0] = autoPost({
        urlHock: "../../hock/RFManage/page.json",
        urlProd: "route/RFManage/0",
        success: function (json) {
            obj.$data.RFManage = json.data;
            obj.$data.currentTotal = json.recordsFiltered;
        }
    });
    // 1 RF管理 判断主作业区是否被占用，是否已关联；是否有PDA任务
    p[1] = autoPost({
        urlHock: "",
        urlProd: "route/RFManage/1",
        success: function (json) {

        }
    });
    // 2 RF管理  根据id返回用户信息
    p[2] = autoPost({
        urlHock: "",
        urlProd: "route/RFManage/2",
        success: function (json) {

        }
    });
    // 3 RF管理 判断主作业区是否重复
    p[3] = autoPost({
        urlHock: "",
        urlProd: "route/RFManage/3",
        success: function (json) {

        }
    });
    // 4 RF管理 更新用户信息
    p[4] = autoPost({
        urlHock: "",
        urlProd: "route/RFManage/4",
        success: function (json) {
            obj.$data.RFManage = json.data;
            obj.$data.currentTotal = json.recordsFiltered;
        }
    });
    // 高级 监视器的 使用方法
    //    RFManage.$watch('date', function () {
    //        if (!this.option.dateStart)return;
    //        /*<debug>*/
    //        console.log(this.option);
    //        /*</debug>*/
    //        post(this, this.option);
    //    }, {deep: true});
    p[0].post( RFManage.option);
    function printfCompile(obj) {
        var resoleveStep = [];
        for (var i = 0; i < obj.multipleSelection.length; i++) {
            resoleveStep.push({
                name: obj.multipleSelection[i].rkrwNo,
                rkrwNo:obj.multipleSelection[i].rkrwNo,
                rkrwDhrq:obj.multipleSelection[i].rkrwDhrq
            });
        }
        obj.printf = resoleveStep;
    }				 //打印









</script>